import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Book extends Item
{
	public Book() 
	{
	}
	public Book(String bookFromFile) throws ParseException 
	{
		super(bookFromFile);
		String [] tokens = bookFromFile.split(";",0);
		this.author = tokens[10];
	}
		
	public boolean containsString(String searchQuery) 
	{
		if(super.containsString(searchQuery))
			return true;
		if(author.toLowerCase().contains(searchQuery.toLowerCase()))
			return true;
		return false;
	}
	public String getItemDetails()
	{
		String itemDetails = super.getItemDetails();
		return itemDetails + "\t" + this.author;
	}
	public String serializeItem() 
	{
		String serializedItem = super.serializeItem();
		serializedItem += ";" + this.author;
		return serializedItem;
	}
	private String author;
}
